<?php 

echo $this->element('top_menu', array('auth', $auth));

?>

<h1>multe</h1>

<form action="/test_1/multe/add" method="post">
	
	<table>
	    <tr>
	        <th>Id</th>
	        <th>targa</th>
	        <th>via</th>
	        <th>comune</th>
	        <th>infrazione</th>
	        <th>agente</th>
	        <th>importo</th>
	        <th>stato</th>
	        <th></th>
	        <th></th>
	    </tr>
	    <!-- Here is where we loop through our $posts array, printing out post info -->
		<?php foreach ($multe as $multa): ?> 
		<tr>
			<td><?php echo $multa['Multa']['id']; ?></td> 
			<td><?php echo $this->Html->link($multa['Multa']['targa'], array('controller' => 'multe', 'action' => 'view', $multa['Multa']['id'])); ?></td>
			<td><?php echo $multa['Multa']['via']; ?></td> 
			<td><?php echo $multa['Multa']['comune']; ?></td> 
			<td><?php echo $multa['Multa']['infrazione']; ?></td> 
			<td><?php echo $multa['Multa']['agente_id']; ?></td> 
			<td><?php echo $multa['Multa']['importo']; ?></td> 
			<td><?php echo $multa['Multa']['stato']; ?></td> 
			<td><?php echo $this->Html->link('X', array('controller' => 'multe', 'action' => 'delete', $multa['Multa']['id'])); ?></td>
			<?php if($multa['Multa']['stato']=='D - Da pagare') { ?>
			<td><?php echo $this->Html->link('Paga', array('controller' => 'multe', 'action' => 'paga', $multa['Multa']['id'])); ?></td>
			<?php } ?>
		</tr>
		<?php endforeach; ?>
		<?php unset($multe); ?> 
	</table>

	<input type="submit" value="Aggiungi" />
	<a href="/test_1/multe/ricerca">Ricerca</a>
	<a href="/test_1/multe/verificaPagamenti">Verifica Pagamenti</a>
</form>